package com.jlh2.study.core.dal.daointerface;

import java.io.Serializable;
import java.util.Collection;

import org.hibernate.LockMode;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.toplink.SessionFactory;

import com.jlh2.study.core.dal.dataobject.BaseDO;

public interface BaseDAO {
    public void setSessionFactory(SessionFactory sessionFactory) throws DataAccessException;

    public Collection findAll(DetachedCriteria criteria) throws DataAccessException;

    public BaseDO findObjectById(Class entityClass, Serializable id) throws DataAccessException;

    public BaseDO findObjectByCriteria(DetachedCriteria criteria) throws DataAccessException;

    public Serializable insert(Object entity) throws DataAccessException;

    public void update(Object entity) throws DataAccessException;

    public void update(Object entity, LockMode lockMode) throws DataAccessException;

    public void delete(Object entity) throws DataAccessException;

    public void delete(Object entity, LockMode lockMode) throws DataAccessException;
}
